package com.yjk.controller;


import com.yjk.entity.Class;
import com.yjk.service.IClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yjk
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/class")
public class ClassController {
    @Autowired
    private IClassService cs;
    @GetMapping("/selectAll")
    public List<Class> selectAll(){
        return cs.selectClassAndTeacher();
    }
    @PostMapping("/add")
    public void addClass(@RequestBody Class clazz){
        cs.save(clazz);
    }

}

